﻿namespace Interpreter.BuiltIns
{
	internal class SystemException : Module
	{
		public override void Register(FunctionRegistry registry)
		{
			registry.Register(50, new SerializeStackTrace());
		}

		private class SerializeStackTrace : NativeFunction
		{
			public override Value Do(StackContext stackContext, Value[] args)
			{
				StackTrace stackTrace = (StackTrace)args[0].Value0;
				return new Value(Value.TYPE_STRING, stackTrace.Serialize());
			}
		}
	}
}
